The use of one-dimensional barcodes on consumer products and product packaging has become nearly ubiquitous. These barcodes linearly encode a numerical digit sequence that uniquely identifies the product to which the barcode is affixed. The ability to decode accurately and quickly barcodes under a variety of conditions on a variety of devices poses a number of interesting design challenges. For example, a barcode recognition algorithm must be able to extract information encoded in the barcode robustly under a variety of lighting conditions. Furthermore, the computational cost of signal processing and decoding needs to be low enough to allow real-time operation of barcode recognition on low-powered portable computing devices such as smart phones and electronic tablet computers.
Some bar code labels are smaller than what is specified in the GS1 GTIN/EAN13 standard. These barcode labels have small leading and trailing quite-zone whitespace allowances and a high symbol-bar linear spatial frequency. These characteristics create stringent requirements on the camera system (lens, signal-processing stack) that has to capture the image of the barcode before information can be extracted from the barcode through signal processing.
A first requirement is the ability to resolve the individual lines of the barcode. To resolve the individual lines of the barcode, the spatial sampling frequency needs to be high enough (at least twice as the highest spatial frequency contained in the linear 1D barcode). This requires the camera to be close enough to the barcode such that enough of the sensor's photo sites (pixels) cover the barcode. In other words, the camera needs to be close enough to the barcode such that the pixel resolution of the imaged barcode satisfies the Nyquist-Shannon theorem for the barcode spectrum. If this requirement is violated, one would expect a significant amount of signal aliasing to occur which will severely degrade the information content of the captured signal.
A second requirement is the ability to focus accurately on the barcode symbol to resolve sharply the individual symbol lines of the barcode. Many cameras have a minimum focal distance imposed by the physical and mechanical constraints of the lens assembly. In particular, many mobile device cameras, such as those found in smart phones, lack the ability to focus on objects very near the lens (<5 cm). Consequently, the minimal focus distance imposes a (device specific) lower bound on the distance from the camera to the barcode. If the camera is closer than this distance to the object being imaged, sharp focus is not possible.
Note that the two requirements described above are compatible in a straightforward way—the symbol should be placed as close to the camera lens as the focal mechanism allows, and no closer. The software user interface (or UI) can be designed to encourage proper placement of the symbol in the camera's field of view. Unfortunately, the straightforward solution suffers from a poor user experience. Any target guide for the barcode appropriately scaled to the field of view to encourage the right distancing of the symbol from the camera is likely to be quite small—especially for the tiny barcodes used by some retail stores.
The perceived ease of placement of an object inside a target guide is directly affected by the distance of the object from the camera. There is a direct relationship between the distance of an object from the camera and the relative distance the object travels on screen in a camera image preview for a lateral motion of any given distance. A small adjustment in the position of an object four centimeters from the camera can move the object (in the image and on the screen) a significant distance left, right, up, or down. By contrast, another object several feet away can be similarly repositioned with little or no notable effect in the image.